Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.BUSS
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.DAO
Imports Microsoft.Reporting.WinForms
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.General

Public Class frmPhieuXuatHang
    Private m_XuatHangCtrl As New XuatHangCtrl()
    Public Sub New()
        InitializeComponent()
        DataService.OpenConnection()
    End Sub
    Private Sub frmPhieuXuatHang_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        m_XuatHangCtrl.HienThiComboBox(cmbMaPhieu)
    End Sub

    Private Sub btnTruyXuat_Click(sender As System.Object, e As System.EventArgs) Handles btnTruyXuat.Click
        Dim ketqua As IList(Of XuatHangInfo) = XuatHangCtrl.LayDsXuatHangTheoMa(cmbMaPhieu.SelectedValue.ToString())

        Dim param As IList(Of ReportParameter) = New List(Of ReportParameter)()
        param.Add(New ReportParameter("Ngay", DateTime.Today.Day & "/" & DateTime.Today.Month & "/" & DateTime.Today.Year))

        Me.ReportViewerPhieuXuatHang.LocalReport.SetParameters(param)
        Me.PhieuXuatHangBindingSource.DataSource = ketqua
        Me.ReportViewerPhieuXuatHang.RefreshReport()
    End Sub

    Private Sub btnThoat_Click(sender As System.Object, e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub
End Class